package com.sys.plat.web.core;

import java.util.HashMap;
import java.util.Map;

import org.apache.struts.action.ActionForm;

@SuppressWarnings("unchecked")
public class BaseForm extends ActionForm {

    private static final long serialVersionUID = 1L;
    private int pageno;
    private int pagesize;
    private int pagestart;
    private String property;
    private String order;
    private String ids[];
    private Map<String, String> filter = new HashMap<String, String>(); //filtermap


    public Map getFilter() {
        return filter;
    }

    public void setFilter(Map<String, String> filter) {
        this.filter = filter;
    }

    public int getPageno() {
        return pageno;
    }

    public void setPageno(int pageno) {
        this.pageno = pageno;
    }

    public int getPagesize() {
        return pagesize;
    }

    public void setPagesize(int pagesize) {
        this.pagesize = pagesize;
    }

    public void setF(String key, String value) {
        filter.put(key, value);
    }

    public String getF(String key) {
        return (String) filter.get(key);
    }

    public String[] getIds() {
        return ids;
    }

    public void setIds(String[] ids) {
        this.ids = ids;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public int getPagestart() {
        return pagestart;
    }

    public void setPagestart(int pagestart) {
        this.pagestart = pagestart;
    }

    public String[] getIdsToS() {
        if (this.ids != null) {
            return this.ids[0].split(";");
        }
        return null;
    }
}
